
/*
'===============================================================================
'  Generated From - DAAB_DAL_NET2.vbgen
'  It is based on the DAAB from the November 2005 Enterprise Library
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easily done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  Custom DAL methods should be written into the inherited class.
' 
'  Version: 1.0
'  Date:	30/01/06
'  Summary: SelectOne, SelectAll, SelectAllWForeignKey, Insert, Update, Delete,
'  			DeleteAllWForeignKey.
'===============================================================================
*/
using System;
using System.Data;
using System.Data.Common;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;


namespace PlacementManager.DAL
{
    public abstract class _tblContacts_DAL
    {
		#region Members
		protected int _ContactID;
		protected string _Title;
		protected string _FirstName;
		protected string _LastName;
		protected string _JobTitle;
		protected string _StreetAddress;
		protected string _PostalAddress;
		protected string _TownCode;
		protected string _Phone;
		protected string _Mobile;
		protected string _Fax;
		protected string _Email;
		protected bool _NotCurrent;
		protected string _Qualification;
		protected string _Experience;
		protected int _AgencyID;
		protected string _Comments;
		protected string _OriginalCompany;
		protected bool _AgencyMailOuts;
		protected string _Response;
		protected bool _TakePlacement;
		protected bool _NSwReg;
		protected bool _VicReg;
		protected bool _DivI;
		protected bool _Psych;
		protected bool _Midwifery;
		protected int _Telephonenumber;
		protected string _RegNumber;
		#endregion

		#region Properties
		
		public int ContactID
		{
			get	{ return _ContactID; }
			set	{ _ContactID = value; }
		}
		
		public string Title
		{
			get	{ return _Title; }
			set	{ _Title = value; }
		}
		
		public string FirstName
		{
			get	{ return _FirstName; }
			set	{ _FirstName = value; }
		}
		
		public string LastName
		{
			get	{ return _LastName; }
			set	{ _LastName = value; }
		}
		
		public string JobTitle
		{
			get	{ return _JobTitle; }
			set	{ _JobTitle = value; }
		}
		
		public string StreetAddress
		{
			get	{ return _StreetAddress; }
			set	{ _StreetAddress = value; }
		}
		
		public string PostalAddress
		{
			get	{ return _PostalAddress; }
			set	{ _PostalAddress = value; }
		}
		
		public string TownCode
		{
			get	{ return _TownCode; }
			set	{ _TownCode = value; }
		}
		
		public string Phone
		{
			get	{ return _Phone; }
			set	{ _Phone = value; }
		}
		
		public string Mobile
		{
			get	{ return _Mobile; }
			set	{ _Mobile = value; }
		}
		
		public string Fax
		{
			get	{ return _Fax; }
			set	{ _Fax = value; }
		}
		
		public string Email
		{
			get	{ return _Email; }
			set	{ _Email = value; }
		}
		
		public bool NotCurrent
		{
			get	{ return _NotCurrent; }
			set	{ _NotCurrent = value; }
		}
		
		public string Qualification
		{
			get	{ return _Qualification; }
			set	{ _Qualification = value; }
		}
		
		public string Experience
		{
			get	{ return _Experience; }
			set	{ _Experience = value; }
		}
		
		public int AgencyID
		{
			get	{ return _AgencyID; }
			set	{ _AgencyID = value; }
		}
		
		public string Comments
		{
			get	{ return _Comments; }
			set	{ _Comments = value; }
		}
		
		public string OriginalCompany
		{
			get	{ return _OriginalCompany; }
			set	{ _OriginalCompany = value; }
		}
		
		public bool AgencyMailOuts
		{
			get	{ return _AgencyMailOuts; }
			set	{ _AgencyMailOuts = value; }
		}
		
		public string Response
		{
			get	{ return _Response; }
			set	{ _Response = value; }
		}
		
		public bool TakePlacement
		{
			get	{ return _TakePlacement; }
			set	{ _TakePlacement = value; }
		}
		
		public bool NSwReg
		{
			get	{ return _NSwReg; }
			set	{ _NSwReg = value; }
		}
		
		public bool VicReg
		{
			get	{ return _VicReg; }
			set	{ _VicReg = value; }
		}
		
		public bool DivI
		{
			get	{ return _DivI; }
			set	{ _DivI = value; }
		}
		
		public bool Psych
		{
			get	{ return _Psych; }
			set	{ _Psych = value; }
		}
		
		public bool Midwifery
		{
			get	{ return _Midwifery; }
			set	{ _Midwifery = value; }
		}
		
		public int Telephonenumber
		{
			get	{ return _Telephonenumber; }
			set	{ _Telephonenumber = value; }
		}
		
		public string RegNumber
		{
			get	{ return _RegNumber; }
			set	{ _RegNumber = value; }
		}
		
		#endregion

        //Constructor
        public _tblContacts_DAL()
        {

        }
		
		/// <summary>
		/// Purpose: SelectAll method. This method will Select all rows from the table.
		/// </summary>
		/// <returns></returns>
		public DataSet SelectAll()
        {
            // Create the Database object, using the default database service. The
            // default database service is determined through configuration.
            Database db = DatabaseFactory.CreateDatabase("PlacementManager");

            string sqlCommand = "pr_tblContacts_DAL_SelectAll";
            DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);

            // Retrieve products from the specified category.
            db.AddInParameter(dbCommand, "ErrorCode", DbType.Int32, null);
		
            DataSet dsToReturn = null;
            dsToReturn = db.ExecuteDataSet(dbCommand);
            return dsToReturn;
        }
		
		/// <summary>
		/// Purpose: Select method. This method will Select one existing row from the database, based on the Primary Key.
		/// </summary>
		/// <returns></returns>
		public DataSet SelectOne()
        {
            // Create the Database object, using the default database service. The
            // default database service is determined through configuration.
            Database db = DatabaseFactory.CreateDatabase("PlacementManager");

            string sqlCommand = "pr_tblContacts_DAL_SelectOne";
            DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);

			db.AddInParameter(dbCommand, "ContactID", DbType.Int32, _ContactID);

            db.AddInParameter(dbCommand, "ErrorCode", DbType.Int32, null);
		
            DataSet dsToReturn = null;
            dsToReturn = db.ExecuteDataSet(dbCommand);
            return dsToReturn;
        }
		
	
	
	}
}
